home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Collections.a < prev    next >
Text File  |  1996-05-01  |  21KB  |  833 lines

  1. ;
  2. ;    File:        Collections.a
  3. ;
  4. ;    Contains:    Collection Manager Interfaces
  5. ;
  6. ;    Version:    Technology:    Copland
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__COLLECTIONS__') = 'UNDEFINED' THEN
  19. __COLLECTIONS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__MEMALLOCATORS__') = 'UNDEFINED' THEN
  28.     include 'MemAllocators.a'
  29.     ENDIF
  30. ; ***********
  31. ;  Constants 
  32. ; ***********
  33. ;  Convenience constants for functions which optionally return values 
  34.  
  35. kCollectionDontWantTag            EQU        0
  36. kCollectionDontWantId            EQU        0
  37. kCollectionDontWantSize            EQU        0
  38. kCollectionDontWantAttributes    EQU        0
  39. kCollectionDontWantIndex        EQU        0
  40. kCollectionDontWantData            EQU        0
  41. ;  attributes bits 
  42.  
  43. kCollectionNoAttributes            EQU        $00000000            ; no attributes bits set 
  44. kCollectionAllAttributes        EQU        $FFFFFFFF            ; all attributes bits set 
  45. kCollectionUserAttributes        EQU        $0000FFFF            ; user attributes bits 
  46. kCollectionDefaultAttributes    EQU        $40000000            ; default attributes - unlocked, persistent 
  47. ;
  48. ;    Attribute bits 0 through 15 (entire low word) are reserved for use by the application.
  49. ;    Attribute bits 16 through 31 (entire high word) are reserved for use by the Collection Manager.
  50. ;    Only bits 31 (kCollectionLockBit) and 30 (kCollectionPersistenceBit) currently have meaning.
  51. ;
  52.  
  53. kCollectionUser0Bit                EQU        0
  54. kCollectionUser1Bit                EQU        1
  55. kCollectionUser2Bit                EQU        2
  56. kCollectionUser3Bit                EQU        3
  57. kCollectionUser4Bit                EQU        4
  58. kCollectionUser5Bit                EQU        5
  59. kCollectionUser6Bit                EQU        6
  60. kCollectionUser7Bit                EQU        7
  61. kCollectionUser8Bit                EQU        8
  62. kCollectionUser9Bit                EQU        9
  63. kCollectionUser10Bit            EQU        10
  64. kCollectionUser11Bit            EQU        11
  65. kCollectionUser12Bit            EQU        12
  66. kCollectionUser13Bit            EQU        13
  67. kCollectionUser14Bit            EQU        14
  68. kCollectionUser15Bit            EQU        15
  69. kCollectionReserved0Bit            EQU        16
  70. kCollectionReserved1Bit            EQU        17
  71. kCollectionReserved2Bit            EQU        18
  72. kCollectionReserved3Bit            EQU        19
  73. kCollectionReserved4Bit            EQU        20
  74. kCollectionReserved5Bit            EQU        21
  75. kCollectionReserved6Bit            EQU        22
  76. kCollectionReserved7Bit            EQU        23
  77. kCollectionReserved8Bit            EQU        24
  78. kCollectionReserved9Bit            EQU        25
  79. kCollectionReserved10Bit        EQU        26
  80. kCollectionReserved11Bit        EQU        27
  81. kCollectionReserved12Bit        EQU        28
  82. kCollectionReserved13Bit        EQU        29
  83. kCollectionPersistenceBit        EQU        30
  84. kCollectionLockBit                EQU        31
  85. ;  attribute masks 
  86.  
  87. kCollectionUser0Mask            EQU        $00000001
  88. kCollectionUser1Mask            EQU        $00000002
  89. kCollectionUser2Mask            EQU        $00000004
  90. kCollectionUser3Mask            EQU        $00000008
  91. kCollectionUser4Mask            EQU        $00000010
  92. kCollectionUser5Mask            EQU        $00000020
  93. kCollectionUser6Mask            EQU        $00000040
  94. kCollectionUser7Mask            EQU        $00000080
  95. kCollectionUser8Mask            EQU        $00000100
  96. kCollectionUser9Mask            EQU        $00000200
  97. kCollectionUser10Mask            EQU        $00000400
  98. kCollectionUser11Mask            EQU        $00000800
  99. kCollectionUser12Mask            EQU        $00001000
  100. kCollectionUser13Mask            EQU        $00002000
  101. kCollectionUser14Mask            EQU        $00004000
  102. kCollectionUser15Mask            EQU        $00008000
  103. kCollectionReserved0Mask        EQU        $00010000
  104. kCollectionReserved1Mask        EQU        $00020000
  105. kCollectionReserved2Mask        EQU        $00040000
  106. kCollectionReserved3Mask        EQU        $00080000
  107. kCollectionReserved4Mask        EQU        $00100000
  108. kCollectionReserved5Mask        EQU        $00200000
  109. kCollectionReserved6Mask        EQU        $00400000
  110. kCollectionReserved7Mask        EQU        $00800000
  111. kCollectionReserved8Mask        EQU        $01000000
  112. kCollectionReserved9Mask        EQU        $02000000
  113. kCollectionReserved10Mask        EQU        $04000000
  114. kCollectionReserved11Mask        EQU        $08000000
  115. kCollectionReserved12Mask        EQU        $10000000
  116. kCollectionReserved13Mask        EQU        $20000000
  117. kCollectionPersistenceMask        EQU        $40000000
  118. kCollectionLockMask                EQU        $80000000
  119. ; *********
  120. ;  Types   
  121. ; *********
  122. ;  abstract data type for a collection 
  123.  
  124.  
  125. ;  collection member 4 byte tag 
  126. ; typedef FourCharCode                     CollectionTag
  127.  
  128.     IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
  129.     ENDIF
  130.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  131.     ENDIF
  132. ; *******************************************
  133. ; ************ Public interfaces ************
  134. ; *******************************************
  135.     IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
  136. ;
  137. ; pascal Collection NewCollection(void )
  138. ;
  139.     IF ¨ GENERATINGCFM THEN
  140.         Macro
  141.         _NewCollection
  142.             moveq               #0,D0
  143.             dc.w                $ABF6
  144.         EndM
  145.     ELSE
  146.         IMPORT_CFM_FUNCTION NewCollection
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal void DisposeCollection(Collection c)
  151. ;
  152.     IF ¨ GENERATINGCFM THEN
  153.         Macro
  154.         _DisposeCollection
  155.             moveq               #1,D0
  156.             dc.w                $ABF6
  157.         EndM
  158.     ELSE
  159.         IMPORT_CFM_FUNCTION DisposeCollection
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal Collection CloneCollection(Collection c)
  164. ;
  165.     IF ¨ GENERATINGCFM THEN
  166.         Macro
  167.         _CloneCollection
  168.             moveq               #2,D0
  169.             dc.w                $ABF6
  170.         EndM
  171.     ELSE
  172.         IMPORT_CFM_FUNCTION CloneCollection
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal SInt32 CountCollectionOwners(Collection c)
  177. ;
  178.     IF ¨ GENERATINGCFM THEN
  179.         Macro
  180.         _CountCollectionOwners
  181.             moveq               #3,D0
  182.             dc.w                $ABF6
  183.         EndM
  184.     ELSE
  185.         IMPORT_CFM_FUNCTION CountCollectionOwners
  186.     ENDIF
  187.  
  188. ;
  189. ; pascal Collection CopyCollection(Collection srcCollection, Collection dstCollection)
  190. ;
  191.     IF ¨ GENERATINGCFM THEN
  192.         Macro
  193.         _CopyCollection
  194.             moveq               #4,D0
  195.             dc.w                $ABF6
  196.         EndM
  197.     ELSE
  198.         IMPORT_CFM_FUNCTION CopyCollection
  199.     ENDIF
  200.  
  201. ;
  202. ; pascal SInt32 GetCollectionDefaultAttributes(Collection c)
  203. ;
  204.     IF ¨ GENERATINGCFM THEN
  205.         Macro
  206.         _GetCollectionDefaultAttributes
  207.             moveq               #5,D0
  208.             dc.w                $ABF6
  209.         EndM
  210.     ELSE
  211.         IMPORT_CFM_FUNCTION GetCollectionDefaultAttributes
  212.     ENDIF
  213.  
  214. ;
  215. ; pascal void SetCollectionDefaultAttributes(Collection c, SInt32 whichAttributes, SInt32 newAttributes)
  216. ;
  217.     IF ¨ GENERATINGCFM THEN
  218.         Macro
  219.         _SetCollectionDefaultAttributes
  220.             moveq               #6,D0
  221.             dc.w                $ABF6
  222.         EndM
  223.     ELSE
  224.         IMPORT_CFM_FUNCTION SetCollectionDefaultAttributes
  225.     ENDIF
  226.  
  227. ;
  228. ; pascal SInt32 CountCollectionItems(Collection c)
  229. ;
  230.     IF ¨ GENERATINGCFM THEN
  231.         Macro
  232.         _CountCollectionItems
  233.             moveq               #7,D0
  234.             dc.w                $ABF6
  235.         EndM
  236.     ELSE
  237.         IMPORT_CFM_FUNCTION CountCollectionItems
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal OSErr AddCollectionItem(Collection c, CollectionTag tag, SInt32 id, SInt32 itemSize, void *itemData)
  242. ;
  243.     IF ¨ GENERATINGCFM THEN
  244.         Macro
  245.         _AddCollectionItem
  246.             moveq               #8,D0
  247.             dc.w                $ABF6
  248.         EndM
  249.     ELSE
  250.         IMPORT_CFM_FUNCTION AddCollectionItem
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal OSErr GetCollectionItem(Collection c, CollectionTag tag, SInt32 id, SInt32 *itemSize, void *itemData)
  255. ;
  256.     IF ¨ GENERATINGCFM THEN
  257.         Macro
  258.         _GetCollectionItem
  259.             moveq               #9,D0
  260.             dc.w                $ABF6
  261.         EndM
  262.     ELSE
  263.         IMPORT_CFM_FUNCTION GetCollectionItem
  264.     ENDIF
  265.  
  266. ;
  267. ; pascal OSErr RemoveCollectionItem(Collection c, CollectionTag tag, SInt32 id)
  268. ;
  269.     IF ¨ GENERATINGCFM THEN
  270.         Macro
  271.         _RemoveCollectionItem
  272.             moveq               #10,D0
  273.             dc.w                $ABF6
  274.         EndM
  275.     ELSE
  276.         IMPORT_CFM_FUNCTION RemoveCollectionItem
  277.     ENDIF
  278.  
  279. ;
  280. ; pascal OSErr SetCollectionItemInfo(Collection c, CollectionTag tag, SInt32 id, SInt32 whichAttributes, SInt32 newAttributes)
  281. ;
  282.     IF ¨ GENERATINGCFM THEN
  283.         Macro
  284.         _SetCollectionItemInfo
  285.             moveq               #11,D0
  286.             dc.w                $ABF6
  287.         EndM
  288.     ELSE
  289.         IMPORT_CFM_FUNCTION SetCollectionItemInfo
  290.     ENDIF
  291.  
  292. ;
  293. ; pascal OSErr GetCollectionItemInfo(Collection c, CollectionTag tag, SInt32 id, SInt32 *index, SInt32 *itemSize, SInt32 *attributes)
  294. ;
  295.     IF ¨ GENERATINGCFM THEN
  296.         Macro
  297.         _GetCollectionItemInfo
  298.             moveq               #12,D0
  299.             dc.w                $ABF6
  300.         EndM
  301.     ELSE
  302.         IMPORT_CFM_FUNCTION GetCollectionItemInfo
  303.     ENDIF
  304.  
  305. ;
  306. ; pascal OSErr ReplaceIndexedCollectionItem(Collection c, SInt32 index, SInt32 itemSize, void *itemData)
  307. ;
  308.     IF ¨ GENERATINGCFM THEN
  309.         Macro
  310.         _ReplaceIndexedCollectionItem
  311.             moveq               #13,D0
  312.             dc.w                $ABF6
  313.         EndM
  314.     ELSE
  315.         IMPORT_CFM_FUNCTION ReplaceIndexedCollectionItem
  316.     ENDIF
  317.  
  318. ;
  319. ; pascal OSErr GetIndexedCollectionItem(Collection c, SInt32 index, SInt32 *itemSize, void *itemData)
  320. ;
  321.     IF ¨ GENERATINGCFM THEN
  322.         Macro
  323.         _GetIndexedCollectionItem
  324.             moveq               #14,D0
  325.             dc.w                $ABF6
  326.         EndM
  327.     ELSE
  328.         IMPORT_CFM_FUNCTION GetIndexedCollectionItem
  329.     ENDIF
  330.  
  331. ;
  332. ; pascal OSErr RemoveIndexedCollectionItem(Collection c, SInt32 index)
  333. ;
  334.     IF ¨ GENERATINGCFM THEN
  335.         Macro
  336.         _RemoveIndexedCollectionItem
  337.             moveq               #15,D0
  338.             dc.w                $ABF6
  339.         EndM
  340.     ELSE
  341.         IMPORT_CFM_FUNCTION RemoveIndexedCollectionItem
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal OSErr SetIndexedCollectionItemInfo(Collection c, SInt32 index, SInt32 whichAttributes, SInt32 newAttributes)
  346. ;
  347.     IF ¨ GENERATINGCFM THEN
  348.         Macro
  349.         _SetIndexedCollectionItemInfo
  350.             moveq               #16,D0
  351.             dc.w                $ABF6
  352.         EndM
  353.     ELSE
  354.         IMPORT_CFM_FUNCTION SetIndexedCollectionItemInfo
  355.     ENDIF
  356.  
  357. ;
  358. ; pascal OSErr GetIndexedCollectionItemInfo(Collection c, SInt32 index, CollectionTag *tag, SInt32 *id, SInt32 *itemSize, SInt32 *attributes)
  359. ;
  360.     IF ¨ GENERATINGCFM THEN
  361.         Macro
  362.         _GetIndexedCollectionItemInfo
  363.             moveq               #17,D0
  364.             dc.w                $ABF6
  365.         EndM
  366.     ELSE
  367.         IMPORT_CFM_FUNCTION GetIndexedCollectionItemInfo
  368.     ENDIF
  369.  
  370. ;
  371. ; pascal Boolean CollectionTagExists(Collection c, CollectionTag tag)
  372. ;
  373.     IF ¨ GENERATINGCFM THEN
  374.         Macro
  375.         _CollectionTagExists
  376.             moveq               #18,D0
  377.             dc.w                $ABF6
  378.         EndM
  379.     ELSE
  380.         IMPORT_CFM_FUNCTION CollectionTagExists
  381.     ENDIF
  382.  
  383. ;
  384. ; pascal SInt32 CountCollectionTags(Collection c)
  385. ;
  386.     IF ¨ GENERATINGCFM THEN
  387.         Macro
  388.         _CountCollectionTags
  389.             moveq               #19,D0
  390.             dc.w                $ABF6
  391.         EndM
  392.     ELSE
  393.         IMPORT_CFM_FUNCTION CountCollectionTags
  394.     ENDIF
  395.  
  396. ;
  397. ; pascal OSErr GetIndexedCollectionTag(Collection c, SInt32 tagIndex, CollectionTag *tag)
  398. ;
  399.     IF ¨ GENERATINGCFM THEN
  400.         Macro
  401.         _GetIndexedCollectionTag
  402.             moveq               #20,D0
  403.             dc.w                $ABF6
  404.         EndM
  405.     ELSE
  406.         IMPORT_CFM_FUNCTION GetIndexedCollectionTag
  407.     ENDIF
  408.  
  409. ;
  410. ; pascal SInt32 CountTaggedCollectionItems(Collection c, CollectionTag tag)
  411. ;
  412.     IF ¨ GENERATINGCFM THEN
  413.         Macro
  414.         _CountTaggedCollectionItems
  415.             moveq               #21,D0
  416.             dc.w                $ABF6
  417.         EndM
  418.     ELSE
  419.         IMPORT_CFM_FUNCTION CountTaggedCollectionItems
  420.     ENDIF
  421.  
  422. ;
  423. ; pascal OSErr GetTaggedCollectionItem(Collection c, CollectionTag tag, SInt32 whichItem, SInt32 *itemSize, void *itemData)
  424. ;
  425.     IF ¨ GENERATINGCFM THEN
  426.         Macro
  427.         _GetTaggedCollectionItem
  428.             moveq               #22,D0
  429.             dc.w                $ABF6
  430.         EndM
  431.     ELSE
  432.         IMPORT_CFM_FUNCTION GetTaggedCollectionItem
  433.     ENDIF
  434.  
  435. ;
  436. ; pascal OSErr GetTaggedCollectionItemInfo(Collection c, CollectionTag tag, SInt32 whichItem, SInt32 *id, SInt32 *index, SInt32 *itemSize, SInt32 *attributes)
  437. ;
  438.     IF ¨ GENERATINGCFM THEN
  439.         Macro
  440.         _GetTaggedCollectionItemInfo
  441.             moveq               #23,D0
  442.             dc.w                $ABF6
  443.         EndM
  444.     ELSE
  445.         IMPORT_CFM_FUNCTION GetTaggedCollectionItemInfo
  446.     ENDIF
  447.  
  448. ;
  449. ; pascal void PurgeCollection(Collection c, SInt32 whichAttributes, SInt32 matchingAttributes)
  450. ;
  451.     IF ¨ GENERATINGCFM THEN
  452.         Macro
  453.         _PurgeCollection
  454.             moveq               #24,D0
  455.             dc.w                $ABF6
  456.         EndM
  457.     ELSE
  458.         IMPORT_CFM_FUNCTION PurgeCollection
  459.     ENDIF
  460.  
  461. ;
  462. ; pascal void PurgeCollectionTag(Collection c, CollectionTag tag)
  463. ;
  464.     IF ¨ GENERATINGCFM THEN
  465.         Macro
  466.         _PurgeCollectionTag
  467.             moveq               #25,D0
  468.             dc.w                $ABF6
  469.         EndM
  470.     ELSE
  471.         IMPORT_CFM_FUNCTION PurgeCollectionTag
  472.     ENDIF
  473.  
  474. ;
  475. ; pascal void EmptyCollection(Collection c)
  476. ;
  477.     IF ¨ GENERATINGCFM THEN
  478.         Macro
  479.         _EmptyCollection
  480.             moveq               #26,D0
  481.             dc.w                $ABF6
  482.         EndM
  483.     ELSE
  484.         IMPORT_CFM_FUNCTION EmptyCollection
  485.     ENDIF
  486.  
  487.     ENDIF
  488.     IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
  489. ;
  490. ; pascal OSErr FlattenCollection(Collection c, CollectionFlattenUPP flattenProc, void *refCon)
  491. ;
  492.     IF ¨ GENERATINGCFM THEN
  493.         Macro
  494.         _FlattenCollection
  495.             moveq               #27,D0
  496.             dc.w                $ABF6
  497.         EndM
  498.     ELSE
  499.         IMPORT_CFM_FUNCTION FlattenCollection
  500.     ENDIF
  501.  
  502. ;
  503. ; pascal OSErr FlattenPartialCollection(Collection c, CollectionFlattenUPP flattenProc, void *refCon, SInt32 whichAttributes, SInt32 matchingAttributes)
  504. ;
  505.     IF ¨ GENERATINGCFM THEN
  506.         Macro
  507.         _FlattenPartialCollection
  508.             moveq               #28,D0
  509.             dc.w                $ABF6
  510.         EndM
  511.     ELSE
  512.         IMPORT_CFM_FUNCTION FlattenPartialCollection
  513.     ENDIF
  514.  
  515. ;
  516. ; pascal OSErr UnflattenCollection(Collection c, CollectionFlattenUPP flattenProc, void *refCon)
  517. ;
  518.     IF ¨ GENERATINGCFM THEN
  519.         Macro
  520.         _UnflattenCollection
  521.             moveq               #29,D0
  522.             dc.w                $ABF6
  523.         EndM
  524.     ELSE
  525.         IMPORT_CFM_FUNCTION UnflattenCollection
  526.     ENDIF
  527.  
  528. ;
  529. ; pascal CollectionExceptionUPP GetCollectionExceptionProc(Collection c)
  530. ;
  531.     IF ¨ GENERATINGCFM THEN
  532.         Macro
  533.         _GetCollectionExceptionProc
  534.             moveq               #30,D0
  535.             dc.w                $ABF6
  536.         EndM
  537.     ELSE
  538.         IMPORT_CFM_FUNCTION GetCollectionExceptionProc
  539.     ENDIF
  540.  
  541. ;
  542. ; pascal void SetCollectionExceptionProc(Collection c, CollectionExceptionUPP exceptionProc)
  543. ;
  544.     IF ¨ GENERATINGCFM THEN
  545.         Macro
  546.         _SetCollectionExceptionProc
  547.             moveq               #31,D0
  548.             dc.w                $ABF6
  549.         EndM
  550.     ELSE
  551.         IMPORT_CFM_FUNCTION SetCollectionExceptionProc
  552.     ENDIF
  553.  
  554. ;
  555. ; pascal Collection GetNewCollection(SInt16 collectionID)
  556. ;
  557.     IF ¨ GENERATINGCFM THEN
  558.         Macro
  559.         _GetNewCollection
  560.             moveq               #32,D0
  561.             dc.w                $ABF6
  562.         EndM
  563.     ELSE
  564.         IMPORT_CFM_FUNCTION GetNewCollection
  565.     ENDIF
  566.  
  567.     ENDIF
  568.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  569. ;
  570. ; extern OSStatus NewCollectionFromAllocator(MemAllocatorRef allocator, Collection *c)
  571. ;
  572.     IF GENERATINGCFM THEN
  573.         IMPORT_CFM_FUNCTION NewCollectionFromAllocator
  574.     ENDIF
  575.  
  576. ;
  577. ; extern OSStatus GetCollectionItemData(Collection c, CollectionTag tag, UInt32 id, ByteCount sizeAllowed, ByteCount *sizeReturned, void *itemData)
  578. ;
  579.     IF GENERATINGCFM THEN
  580.         IMPORT_CFM_FUNCTION GetCollectionItemData
  581.     ENDIF
  582.  
  583. ;
  584. ; extern OSStatus GetIndexedCollectionItemData(Collection c, UInt32 index, ByteCount sizeAllowed, ByteCount *sizeReturned, void *itemData)
  585. ;
  586.     IF GENERATINGCFM THEN
  587.         IMPORT_CFM_FUNCTION GetIndexedCollectionItemData
  588.     ENDIF
  589.  
  590. ;
  591. ; extern OSStatus GetTaggedCollectionItemData(Collection c, CollectionTag tag, UInt32 whichItem, ByteCount sizeAllowed, ByteCount *sizeReturned, void *itemData)
  592. ;
  593.     IF GENERATINGCFM THEN
  594.         IMPORT_CFM_FUNCTION GetTaggedCollectionItemData
  595.     ENDIF
  596.  
  597. ;
  598. ; extern OSStatus GetFlattenedCollectionSize(Collection c, ByteCount *size)
  599. ;
  600.     IF GENERATINGCFM THEN
  601.         IMPORT_CFM_FUNCTION GetFlattenedCollectionSize
  602.     ENDIF
  603.  
  604. ;
  605. ; extern OSStatus GetFlattenedPartialCollectionSize(Collection c, UInt32 whichAttributes, UInt32 matchingAttributes, ByteCount *size)
  606. ;
  607.     IF GENERATINGCFM THEN
  608.         IMPORT_CFM_FUNCTION GetFlattenedPartialCollectionSize
  609.     ENDIF
  610.  
  611. ;
  612. ; extern OSStatus FlattenCollectionToBuffer(Collection c, void *dataPtr, ByteCount sizeAllowed, ByteCount *sizeFlattened)
  613. ;
  614.     IF GENERATINGCFM THEN
  615.         IMPORT_CFM_FUNCTION FlattenCollectionToBuffer
  616.     ENDIF
  617.  
  618. ;
  619. ; extern OSStatus FlattenPartialCollectionToBuffer(Collection c, UInt32 whichAttributes, UInt32 matchingAttributes, void *dataPtr, ByteCount sizeAllowed, ByteCount *sizeFlattened)
  620. ;
  621.     IF GENERATINGCFM THEN
  622.         IMPORT_CFM_FUNCTION FlattenPartialCollectionToBuffer
  623.     ENDIF
  624.  
  625. ;
  626. ; extern OSStatus UnflattenCollectionFromBuffer(Collection c, void *dataPtr, ByteCount size)
  627. ;
  628.     IF GENERATINGCFM THEN
  629.         IMPORT_CFM_FUNCTION UnflattenCollectionFromBuffer
  630.     ENDIF
  631.  
  632. ;
  633. ; extern OSStatus FlattenCollectionPreemptive(Collection c, CollectionFlattenPreemptiveProcPtr flattenProc, void *refCon)
  634. ;
  635.     IF GENERATINGCFM THEN
  636.         IMPORT_CFM_FUNCTION FlattenCollectionPreemptive
  637.     ENDIF
  638.  
  639. ;
  640. ; extern OSStatus FlattenPartialCollectionPreemptive(Collection c, CollectionFlattenPreemptiveProcPtr flattenProc, void *refCon, UInt32 whichAttributes, UInt32 matchingAttributes)
  641. ;
  642.     IF GENERATINGCFM THEN
  643.         IMPORT_CFM_FUNCTION FlattenPartialCollectionPreemptive
  644.     ENDIF
  645.  
  646. ;
  647. ; extern OSStatus UnflattenCollectionPreemptive(Collection c, CollectionFlattenPreemptiveProcPtr flattenProc, void *refCon)
  648. ;
  649.     IF GENERATINGCFM THEN
  650.         IMPORT_CFM_FUNCTION UnflattenCollectionPreemptive
  651.     ENDIF
  652.  
  653. ;
  654. ; extern CollectionExceptionPreemptiveProcPtr GetCollectionExceptionProcPreemptive(Collection c)
  655. ;
  656.     IF GENERATINGCFM THEN
  657.         IMPORT_CFM_FUNCTION GetCollectionExceptionProcPreemptive
  658.     ENDIF
  659.  
  660. ;
  661. ; extern OSStatus SetCollectionExceptionProcPreemptive(Collection c, CollectionExceptionPreemptiveProcPtr exceptionProc)
  662. ;
  663.     IF GENERATINGCFM THEN
  664.         IMPORT_CFM_FUNCTION SetCollectionExceptionProcPreemptive
  665.     ENDIF
  666.  
  667.     ENDIF
  668.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  669. ; ********************************************************************
  670. ; ************* Utility routines for handle-based access *************
  671. ; ********************************************************************
  672. ;
  673. ; pascal OSErr AddCollectionItemHdl(Collection aCollection, CollectionTag tag, SInt32 id, Handle itemData)
  674. ;
  675.     IF ¨ GENERATINGCFM THEN
  676.         Macro
  677.         _AddCollectionItemHdl
  678.             moveq               #33,D0
  679.             dc.w                $ABF6
  680.         EndM
  681.     ELSE
  682.         IMPORT_CFM_FUNCTION AddCollectionItemHdl
  683.     ENDIF
  684.  
  685. ;
  686. ; pascal OSErr GetCollectionItemHdl(Collection aCollection, CollectionTag tag, SInt32 id, Handle itemData)
  687. ;
  688.     IF ¨ GENERATINGCFM THEN
  689.         Macro
  690.         _GetCollectionItemHdl
  691.             moveq               #34,D0
  692.             dc.w                $ABF6
  693.         EndM
  694.     ELSE
  695.         IMPORT_CFM_FUNCTION GetCollectionItemHdl
  696.     ENDIF
  697.  
  698. ;
  699. ; pascal OSErr ReplaceIndexedCollectionItemHdl(Collection aCollection, SInt32 index, Handle itemData)
  700. ;
  701.     IF ¨ GENERATINGCFM THEN
  702.         Macro
  703.         _ReplaceIndexedCollectionItemHdl
  704.             moveq               #35,D0
  705.             dc.w                $ABF6
  706.         EndM
  707.     ELSE
  708.         IMPORT_CFM_FUNCTION ReplaceIndexedCollectionItemHdl
  709.     ENDIF
  710.  
  711. ;
  712. ; pascal OSErr GetIndexedCollectionItemHdl(Collection aCollection, SInt32 index, Handle itemData)
  713. ;
  714.     IF ¨ GENERATINGCFM THEN
  715.         Macro
  716.         _GetIndexedCollectionItemHdl
  717.             moveq               #36,D0
  718.             dc.w                $ABF6
  719.         EndM
  720.     ELSE
  721.         IMPORT_CFM_FUNCTION GetIndexedCollectionItemHdl
  722.     ENDIF
  723.  
  724. ;
  725. ; pascal OSErr FlattenCollectionToHdl(Collection aCollection, Handle flattened)
  726. ;
  727.     IF ¨ GENERATINGCFM THEN
  728.         Macro
  729.         _FlattenCollectionToHdl
  730.             moveq               #37,D0
  731.             dc.w                $ABF6
  732.         EndM
  733.     ELSE
  734.         IMPORT_CFM_FUNCTION FlattenCollectionToHdl
  735.     ENDIF
  736.  
  737. ;
  738. ; pascal OSErr UnflattenCollectionFromHdl(Collection aCollection, Handle flattened)
  739. ;
  740.     IF ¨ GENERATINGCFM THEN
  741.         Macro
  742.         _UnflattenCollectionFromHdl
  743.             moveq               #38,D0
  744.             dc.w                $ABF6
  745.         EndM
  746.     ELSE
  747.         IMPORT_CFM_FUNCTION UnflattenCollectionFromHdl
  748.     ENDIF
  749.  
  750.     ENDIF
  751.     IF OLDROUTINENAMES THEN
  752.  
  753. dontWantTag                        EQU        0
  754. dontWantId                        EQU        0
  755. dontWantSize                    EQU        0
  756. dontWantAttributes                EQU        0
  757. dontWantIndex                    EQU        0
  758. dontWantData                    EQU        0
  759.  
  760. noCollectionAttributes            EQU        $00000000
  761. allCollectionAttributes            EQU        $FFFFFFFF
  762. userCollectionAttributes        EQU        $0000FFFF
  763. defaultCollectionAttributes        EQU        $40000000
  764.  
  765. collectionUser0Bit                EQU        0
  766. collectionUser1Bit                EQU        1
  767. collectionUser2Bit                EQU        2
  768. collectionUser3Bit                EQU        3
  769. collectionUser4Bit                EQU        4
  770. collectionUser5Bit                EQU        5
  771. collectionUser6Bit                EQU        6
  772. collectionUser7Bit                EQU        7
  773. collectionUser8Bit                EQU        8
  774. collectionUser9Bit                EQU        9
  775. collectionUser10Bit                EQU        10
  776. collectionUser11Bit                EQU        11
  777. collectionUser12Bit                EQU        12
  778. collectionUser13Bit                EQU        13
  779. collectionUser14Bit                EQU        14
  780. collectionUser15Bit                EQU        15
  781. collectionReserved0Bit            EQU        16
  782. collectionReserved1Bit            EQU        17
  783. collectionReserved2Bit            EQU        18
  784. collectionReserved3Bit            EQU        19
  785. collectionReserved4Bit            EQU        20
  786. collectionReserved5Bit            EQU        21
  787. collectionReserved6Bit            EQU        22
  788. collectionReserved7Bit            EQU        23
  789. collectionReserved8Bit            EQU        24
  790. collectionReserved9Bit            EQU        25
  791. collectionReserved10Bit            EQU        26
  792. collectionReserved11Bit            EQU        27
  793. collectionReserved12Bit            EQU        28
  794. collectionReserved13Bit            EQU        29
  795. collectionPersistenceBit        EQU        30
  796. collectionLockBit                EQU        31
  797.  
  798. collectionUser0Mask                EQU        $00000001
  799. collectionUser1Mask                EQU        $00000002
  800. collectionUser2Mask                EQU        $00000004
  801. collectionUser3Mask                EQU        $00000008
  802. collectionUser4Mask                EQU        $00000010
  803. collectionUser5Mask                EQU        $00000020
  804. collectionUser6Mask                EQU        $00000040
  805. collectionUser7Mask                EQU        $00000080
  806. collectionUser8Mask                EQU        $00000100
  807. collectionUser9Mask                EQU        $00000200
  808. collectionUser10Mask            EQU        $00000400
  809. collectionUser11Mask            EQU        $00000800
  810. collectionUser12Mask            EQU        $00001000
  811. collectionUser13Mask            EQU        $00002000
  812. collectionUser14Mask            EQU        $00004000
  813. collectionUser15Mask            EQU        $00008000
  814. collectionReserved0Mask            EQU        $00010000
  815. collectionReserved1Mask            EQU        $00020000
  816. collectionReserved2Mask            EQU        $00040000
  817. collectionReserved3Mask            EQU        $00080000
  818. collectionReserved4Mask            EQU        $00100000
  819. collectionReserved5Mask            EQU        $00200000
  820. collectionReserved6Mask            EQU        $00400000
  821. collectionReserved7Mask            EQU        $00800000
  822. collectionReserved8Mask            EQU        $01000000
  823. collectionReserved9Mask            EQU        $02000000
  824. collectionReserved10Mask        EQU        $04000000
  825. collectionReserved11Mask        EQU        $08000000
  826. collectionReserved12Mask        EQU        $10000000
  827. collectionReserved13Mask        EQU        $20000000
  828. collectionPersistenceMask        EQU        $40000000
  829. collectionLockMask                EQU        $80000000
  830.     ENDIF
  831.     ENDIF ; __COLLECTIONS__ 
  832.  
  833.